import React, { memo, FC } from 'react';
import { Divider } from 'antd';
import './style.less';

interface navProps {
  introduce?: string;
  content?: string;
}

interface IProps {
  navProps: navProps;

  navName: string;
}

const ComponentDescription: FC<IProps> = memo(function ComponentDescription({
  navProps = {},
  navName = window.sessionStorage.getItem('navName') || '首页',
}) {
  return (
    <div id="common-description">
      <div className="nav-url">
        <h1 className="nav-name">{navName}</h1>
      </div>
      <Divider className="nav-divider" />
      <div className="nav-alert" title={navProps.content}>
        {navProps.content}
      </div>
    </div>
  );
});

export default ComponentDescription;
